/*
 * DataSource.js
 * Example using a data source
 *  
 *  
*/

response.setContentType("text/html");

var ds = data.getDataSource("XMLDataSource");


var result = ds.doQuery();

var buffer = "<table border=1>";
for (var i=0; i< result.size(); i++) {
	buffer += "<tr>";
	var record = result.get(i);
	var keys = record.keys.toArray();
	
	if (i==0) {
		for (j in keys) {
			buffer += "<th>" + keys[j] + "</th>";
		}
		buffer +="</tr><tr>";
	}
	
	
	for (j in keys) {
		buffer += "<td>" + record.get(keys[j]) + "</td>";
	}
	
	
	
	buffer += "</tr>";
	
}
buffer += "</table>";


buffer;
